package com.llb666.java.thread;

/**
 * @author liulibin
 */
public class TreadLocalDemo {
    public static ThreadLocal<Long> x = new ThreadLocal<Long>(){
        @Override
        protected Long initialValue(){
            return Thread.currentThread().getId();
        }
    };
    public static void main(String[] args) {
        new Thread(){
            @Override
            public void run(){
                System.out.println(x.get());
            }
        }.start();
        System.out.println(x.get());
        x.set(101L);
        System.out.println(x.get());
    }
}
